package com.cn.wanxi.service;

import com.cn.wanxi.dao.ProductDao;
import com.cn.wanxi.model.ProductModel;

public class ProductService {
    public ProductModel[] getProductModels() {
        ProductDao productDao = new ProductDao();
        int length = productDao.dnames.length;
        ProductModel[] productModels = new ProductModel[length];
        for (int i = 0; i < length; i++) {
            ProductModel model = new ProductModel();
            model.setImgHref(productDao.imgHrefs[i]);
            model.setDname(productDao.dnames[i]);
            model.setPrice(productDao.prices[i]);
            productModels[i] = model;
        }
        return productModels;
    }
}
